﻿using System.Collections.Generic;
using ShopB2C.Entity;
using ShopB2C.ViewModels;

namespace ShopB2C.Interfaces
{
    public interface IOrder
    {
        /// <summary>
        /// 将购物车增加到订单
        /// </summary>
        /// <param name="addressId">收货地址ID</param>
        /// <param name="uid">关联的用户ID</param>
        /// <param name="orderId">订单ID</param>
        /// <returns>受影响的行</returns>
        int AddToOrder(string orderId , int addressId , int uid,int cartType);
        /// <summary>
        /// 订单列表
        /// </summary>
        /// <param name="uid">关联的用户ID</param>
        /// <param name="pageIndex">分页页码</param>
        /// <returns>订单列表</returns>
        List<OrderEntity> SaleList(int uid , int pageIndex , ref int pageCountx);
        /// <summary>
        /// 订单预览
        /// </summary>
        /// <param name="uid">关联的用户ID</param>
        /// <param name="orderId">订单ID</param>
        /// <returns>订单对象预览</returns>
        OrderViewModel SaleOrderView(int uid , string orderId);
        /// <summary>
        /// 购买记录
        /// </summary>
        /// <param name="productId">关联的产品ID</param>
        /// <returns>产品购买记录</returns>
        List<UserEntity> SaleHistoryList(int productId);
        /// <summary>
        /// 删除订单
        /// </summary>
        /// <param name="orderId">订单ID</param>
        /// <param name="uid">用户ID</param>
        /// <returns>返回的删除订单的操作码</returns>
        int SaleDeleteItem(string orderId , int uid);
        /// <summary>
        /// 订单处理    
        /// </summary>
        /// <param name="state">更改后的状态</param>
        /// <param name="expressNo">快递编号</param>
        /// <param name="description">物流说明</param>
        /// <param name="orderId">订单ID</param>
        /// <param name="uid">用户ID</param>
        /// <returns>受影响的行</returns>
        int SalesProcess(int state , string expressNo , string description , string orderId , int uid);
    }
}
